{include file="public/head"}
<style>
    .x-body {
        min-width: 1200px;
    }

    body {
        overflow-x: scroll;
    }
</style>
<body>
<div class="x-body">
    <div class="lotus-nav">
        <div class="layui-input-inline">
            <input id="order_no" name="order_no" class="layui-input" placeholder="找货订单号" value="{$Think.get.order_no}">
        </div>
        <button class="layui-btn layui-btn-sm" onclick="search()">
            <i class="layui-icon layui-icon-search"></i>搜索
        </button>
        <input type="hidden" id="company_id" name="company_id" value="{$Think.get.company_id}">
        <span class="x-right">共有数据:<i class="i_count">{$data->total()}</i>条
            <button onclick="javascript:location.reload()" class="layui-btn-default ">
                <i class="layui-icon layui-icon-refresh"></i>
            </button>
        </span>

    </div>


    <table class="layui-table">
        <thead>
        <tr>
            <th style="max-width:75px;text-align: center">

            </th>
            <th style="width:115px;text-align:center">商品图片</th>
            <th>标题</th>
            <th style="width: 40px;text-align:center">数量</th>
            <th style="min-width: 150px;text-align:center">找货订单号</th>
            <th style="min-width: 150px;text-align:center">物流追踪号</th>
            <th style="width: 60px;text-align:center">采购状态</th>
            {if isession('super') == 2}
            <th style="width: 60px;text-align:center">采购人员</th>
            {/if}
            <th style="width: 60px;text-align:center">审核状态</th>
            <th style="width: 120px;text-align:center">创建时间</th>
            <th style="width: 30px;text-align:center">操作</th>
        </thead>
        <tbody>

        {volist name="list" id="vo"}
        <tr>
            <td style="text-align:center">{$i}</td>
            <td style="text-align: center">
                {if empty($vo['imgpath'])}
                <img src="__images__/noimg.png">
                {else/}
                <img src="{$vo['imgpath']}" onclick="previewImg(this)">
                {/if}
            </td>
            <td>
                {if empty($vo['url'])}
                {$vo.title}
                {else/}
                <a href="{$vo.url}" style="color: #01AAED;" target="_blank">{$vo.title}</a>
                {/if}
            </td>
            <td style="text-align:center">{$vo.num}</td>
            <td style="text-align:center">{$vo.order_no}</td>
            <td style="text-align:center">{$vo.logistics}</td>
            <td style="text-align:center">
                {if $vo['overdue'] == 1}
                <b style="color: red">待采购</b>
                {elseif $vo['overdue'] == 2}
                <b style="color: blue">采购中</b>
                {else/}
                <b style="color: green">完成</b>
                {/if}
            </td>
            {if isession('super') == 2}
            <th style="text-align:center">{$vo.linkman}</th>
            {/if}
            <th style="text-align:center">
                {if $vo['audit'] == 3}
                <b style="color: red">未通过</b>
                {elseif $vo['audit'] == 1}
                <b style="color: blue">未审核</b>
                {else/}
                <b style="color: green">已审核</b>
                {/if}
            </th>
            <td style="text-align:center">{$vo['timestamp']|date="Y-m-d H:i",###}</td>
            <td style="text-align:center">
                <button class="layui-btn layui-btn-xs"
                        onclick="x_admin_show('编辑','edit.html?id={$vo.id}&company_id={$Think.get.company_id}')">编辑
                </button>
            </td>
        </tr>
        {/volist}

        </tbody>
    </table>
    <div class="page">
        <div>
            {$data->render()}
        </div>
    </div>
</div>
</body>
{include file="public/foot"}
<script>
    function search() {
        var order_no = $("#order_no").val();
        var company_id = $("#company_id").val();
        location.href = "index.html?order_no=" + order_no + "&company_id=" + company_id;
    }
</script>
